const Layout = () => import("../views/Layout");
const Dashboard = () => import("../views/Home/Dashboard");
const Banner = () => import("../views/Home/Banner/index.vue");
const BannerAdd = () => import("../views/Home/Banner/create");
const BannerEdit = () => import("../views/Home/Banner/edit");
const homeRouter = {
  path: "/home",
  component: Layout,
  redirect: "/home/dashboard",

  meta: {
    title: "home", //zh.json->route的属性名
    icon: "HomeOutlined",
  },
  children: [
    {
      path: "dashboard",
      component: Dashboard,
      name: "dashboard",
      meta: {
        title: "dashboard",
        icon: "ToolOutlined",
        isAffix: true,
      },
    },
    {
      path: "banner",
      component: Banner,
      name: "banner",
      meta: {
        title: "banner",
        icon: "FundViewOutlined",
      },
    },
    {
      path: "banner/add",
      component: BannerAdd,
      name: "bannerAdd",
      hidden: true,
      meta: {
        title: "bannerAdd",
        isKeepAlive: true,
        //记录组件的name当isKeepAlive为true一定要在这边添加name且和组件的name保持一致
        comName: "BannerAdd",
      },
    },
    {
      path: "banner/edit/:id",
      component: BannerEdit,
      name: "bannerEdit",
      hidden: true,
      meta: {
        title: "BannerEdit",
      },
    },
  ],
};
export default homeRouter;
